#include <REGX52.H>

void Delay500ms()		//@12.000MHz
{
	unsigned char data i, j, k;

	i = 4;
	j = 205;
	k = 187;
	do
	{
		do
		{
			while (--k);
		} while (--j);
	} while (--i);
}

void d()
{
	unsigned char i = 0;
	while(1)
	{
		for(i=0;i<8;i++)
		{
			P2 = ~(0x01<<i);
			Delay500ms();
		}
	}
}
 
void d2()
{
	unsigned char i;
	while(1)
	{
		for(i=0;i<8;i++)
		{
			P2 = ~(0X80>>i);
			Delay500ms();
		}
		
		
	}

}

void d3()
{
	unsigned char i;
	while(1)
	{
		for(i=0;i<8;i++)
		{
			P2 = ~(0X80>>i);
			Delay500ms();
		}
	
		for(i=0;i<8;i++)
		{
			P2 = ~(0x01<<i);
			Delay500ms();
		}
		
	}
}
void main(){
	d3();
}